﻿layui.use(['form', 'layer'], function () {
    var form = layui.form,
        layer = layui.layer,
        $ = layui.jquery;
    var loginManager = {
        loginSubmit: function (data) {
            $.ajax({
                type: "POST",
                url: "Interview/Insert",//发送请求  
                data: data.field,
                dataType: "json",
                success: function (result) {
                    if (result.State == 1)
                        layer.alert(result.Message, { icon: 7 });
                    else
                        layer.msg(result.Message, { icon: 1 }, function (index) {
                            location.href = 'Interview/Interview';
                            layer.close(index);
                        });
                }
            });
        }
    }
    //监听提交
    form.on('submit(insertForm)', function (data) {
        loginManager.loginSubmit(data);
        return false;
    });
    $("input[id='AppTime']").dblclick(function () {
        var myDate = new Date;
        var year = myDate.getFullYear();//获取当前年
        var yue = myDate.getMonth() + 1;//获取当前月
        var date = myDate.getDate();//获取当前日
        var h = myDate.getHours();//获取当前小时数(0-23)
        var m = myDate.getMinutes();//获取当前分钟数(0-59)
        var s = myDate.getSeconds();//获取当前秒
        var now = year + '-' + yue + "-" + date + " " + h + ':' + m + ":" + s;
        $(this).val(now);
    })
})